<template>
  <div>
    <div>

      <div v-on:click="show='A'">选项A</div>
      <br>
      <div v-on:click="show='B'">选项B</div>
    </div>
    <foo v-if="show=='A'"></foo>
    <bar v-if="show=='B'"></bar>
  </div>
</template>

<script>
  import Foo from '@/components/foo'
  import Bar from '@/components/bar'
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      show: 'b',
    }
	},
  components: {
    Foo,
    Bar,
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
